﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class Global : MonoBehaviour {

	#region 单例模式

	public static Global _instance;
	public static Global Instance
    {
        get
        {
			return _instance;
        }
    }
		 
	void Awake()
    {
		_instance = this;
		DontDestroyOnLoad(_instance);
	}

	#endregion
	[Header("组件引用")]
	public UIAlert m_Alert;

	[Header("配置信息")]
	public string APIServer = "http://127.0.0.1/api/index.php/";

	[Header("临时变量")]
	public LoginResponseVo AccountInfo;






    // Use this for initialization
    void Start () {
		HttpHelper.Instance.Init(APIServer);
 	}

	public void SwitchScene(SceneList sceneName)
	{
		SceneManager.LoadScene(sceneName.ToString());
	}
	

	public void Alert(string msg,string title = "提示")
	{
		if (m_Alert != null)
		{
			m_Alert.Show(msg, title);
		}
	}
	// Update is called once per frame
	void Update () {
		
	}
}
